Skip to content

Feat/sip 031 boot contract #6261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: release/3.2.0.0.0-rc1
Choose a base branch
from

Conversation

rdeioris
Copy link
Contributor

@rdeioris rdeioris commented Jul 7, 2025

Description

This is the boot-contract and management for SIP-031 initial mint and assignment.

During the epoch-32 activation, 200_000_000 STX are minted and trasferred to the contract.

The contract is still a stub

Applicable issues

Additional info (benefits, drawbacks, caveats)

Checklist

  • Test coverage for new or modified code paths
  • Changelog is updated
  • Required documentation changes (e.g., docs/rpc/openapi.yaml and rpc-endpoints.md for v2 endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo
  • New integration test(s) added to bitcoin-tests.yml

@aldur aldur added the sip-031 label Jul 7, 2025
@aldur aldur moved this to Status: 💻 In Progress in Stacks Core Eng Jul 7, 2025
@aldur aldur added this to the 3.1.0.0.14 milestone Jul 7, 2025
@aldur aldur requested a review from hstove July 7, 2025 15:11
@aldur aldur changed the base branch from develop to release/3.2.0.0.0-rc1 July 11, 2025 15:36
@hstove
Copy link
Contributor

hstove commented Jul 15, 2025

@rdeioris I merged in the release branch just have this branch's diff (which I'm also building on top of) more clean, hope you don't mind!

@hstove hstove linked an issue Jul 16, 2025 that may be closed by this pull request
hstove
hstove previously approved these changes Jul 16, 2025
Copy link
Contributor

@hstove hstove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hstove hstove marked this pull request as ready for review July 16, 2025 04:27
@hstove hstove requested review from a team as code owners July 16, 2025 04:27
@rdeioris
Copy link
Contributor Author

@hstove added a bunch of checks for the mint receipt in the integration test. Please re-review. thanks!

@rdeioris rdeioris requested a review from hstove July 16, 2025 05:57
@aldur aldur moved this from Status: 💻 In Progress to Status: In Review in Stacks Core Eng Jul 16, 2025
@aldur aldur requested review from kantai and obycode July 16, 2025 14:35
Copy link
Contributor

@kantai kantai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, just had a few superficial comments, and would like to see an additional check in the test for the liquid stx supply.


let mut sip_031_initialization_receipt = self.as_transaction(|tx_conn| {
// initialize with a synthetic transaction
debug!("Instantiate {} contract", &sip_031_contract_id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well make this info! -- we only expect this to happen the one time.

ASTRules::PrecheckSize,
None,
)
.expect("FATAL: Failed to process .sip031 contract initialization");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.expect("FATAL: Failed to process .sip031 contract initialization");
.expect("FATAL: Failed to process .sip-031 contract initialization");

};

let boot_code_address = boot_code_addr(mainnet);
let boot_code_auth = boot_code_tx_auth(boot_code_address.clone());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let boot_code_auth = boot_code_tx_auth(boot_code_address.clone());
let boot_code_auth = boot_code_tx_auth(boot_code_address);

);
}

let recipient = PrincipalData::Contract(boot_code_id(SIP_031_NAME, mainnet));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let recipient = PrincipalData::Contract(boot_code_id(SIP_031_NAME, mainnet));
let recipient = PrincipalData::Contract(sip_031_contract_id);

@@ -12756,6 +12760,121 @@ fn test_sip_031_activation() {

assert_eq!(epoch_version, Some(StacksEpochId::Epoch32));

// check if sip-031 boot contract has been deployed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add a check that the liquid ustx supply has incremented correctly?

Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! I just had some very minor comments.

@@ -12635,7 +12639,7 @@ fn write_signer_update(
/// Test SIP-031 activation
///
/// - check epoch 3.2 is active
/// - TODO: check sip031 boot contract has a balance of 200_000_000 STX (TODO)
/// - check sip031 boot contract has a balance of 200_000_000 STX (TODO)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// - check sip031 boot contract has a balance of 200_000_000 STX (TODO)
/// - check sip031 boot contract has a balance of 200_000_000 STX

.unwrap()
.as_str()
.unwrap(),
"200000000000000"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"200000000000000"
SIP_031_INITIAL_MINT.to_string(),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Status: In Review
Development

Successfully merging this pull request may close these issues.

SIP-031: Deploy contract during epoch transition
5 participants